<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <my-demo></my-demo>
    </div>
</body>
<script src="https://cn.vuejs.org/js/vue.js"></script>
<script>
    Vue.component("my-demo", {
      data:function(){
        return {
          title:localStorage.getItem("title"),
          // http://127.0.0.1:5500/demo.html?token=123456
          search:window.location.search.split("?")[1].split("=")[1]
        }
      },
      template:`
        <div>
          <h1>演示组件之间通信的方式
          {{title}}
          <h1>token:{{search}}</h1>
          </h1>
        </div>
      `
    });
    let vm = new Vue({
      mounted() {
        localStorage.setItem("title","周六自习自愿");
      },
      el: "#app",
    });
</script>
</html>